package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile   string `gorm:"type:char(11);not null"`
	Password string `gorm:"type:char(32);not null"`
	IdCard   string `gorm:"type:char(18);not null"`
	RealName string `gorm:"type:varchar(20);not null"`
}

func (u *User) FindAurh(id int64) (*User, error) {
	err := DB.Debug().Where("id=?", id).Find(u).Error
	return u, err
}

func (u *User) UpDataUser() error {
	return DB.Debug().Updates(u).Error
}
